load("@fbsource//tools/build_defs:rust_library.bzl", "rust_library")

oncall("sapling")

rust_library(
    name = "manifest-tree",
    srcs = glob(["src/**/*.rs"]),
    autocargo = {"cargo_toml_config": {
        "bench": [{
            "harness": False,
            "name": "bench",
            "required-features": ["for-tests"],
        }],
        "dependencies_override": {"dev-dependencies": {
            "sapling-manifest": {
                "default-features": False,
                "features": ["for-tests"],
            },
            "sapling-types": {
                "default-features": False,
                "features": ["for-tests"],
            },
        }},
        "extra_buck_dependencies": {
            "dependencies": [
                "fbsource//third-party/rust:quickcheck",
                "fbsource//third-party/rust:rand",
            ],
            "dev-dependencies": [
                "fbsource//third-party/rust:rand",
                "fbsource//third-party/rust:rand_chacha",
                "//eden/scm/lib/manifest:manifest",
                "//eden/scm/lib/minibench:minibench",
                "//eden/scm/lib/types:types",
            ],
        },
        "features": {
            "default": [],
            "for-tests": [
                "quickcheck",
                "rand",
            ],
        },
        "lib": {"name": "manifest-tree"},
        "package": {
            "authors": ["Meta Source Control Team <sourcecontrol-dev@meta.com>"],
            "homepage": "https://sapling-scm.com/",
            "license": "MIT",
            "name": "sapling-manifest-tree",
            "repository": "https://github.com/facebook/sapling",
        },
    }},
    crate_root = "src/lib.rs",
    features = ["for-tests"],
    test_deps = [
        "fbsource//third-party/rust:quickcheck",
        "//eden/scm/lib/dev-logger:dev-logger",
    ],
    deps = [
        "fbsource//third-party/rust:anyhow",
        "fbsource//third-party/rust:bytecount",
        "fbsource//third-party/rust:flume",
        "fbsource//third-party/rust:num_cpus",
        "fbsource//third-party/rust:once_cell",
        "fbsource//third-party/rust:parking_lot",
        "fbsource//third-party/rust:thiserror",
        "fbsource//third-party/rust:threadpool",
        "fbsource//third-party/rust:tracing",
        "//eden/scm/lib/blob:blob",
        "//eden/scm/lib/manifest:manifest",
        "//eden/scm/lib/minibytes:minibytes",
        "//eden/scm/lib/pathmatcher:pathmatcher",
        "//eden/scm/lib/progress/model:progress-model",
        "//eden/scm/lib/storemodel:storemodel",
        "//eden/scm/lib/types:types",
        "//eden/scm/lib/util/factory:factory",
        "//eden/scm/lib/util/format-util:format-util",
    ],
)
